.multi-line-select .ant-select-selector {
  height: auto !important;
  min-height: 56px !important; /* 足够显示至少两行元素的高度 */
  padding: 2px 4px !important;
  border-width: 1px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 120px !important;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

/* 自定义滚动条样式 */
.multi-line-select .ant-select-selector::-webkit-scrollbar {
  width: 6px;
}

.multi-line-select .ant-select-selector::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 3px;
}

.multi-line-select .ant-select-selector::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 3px;
}

.multi-line-select .ant-select-selection-overflow {
  flex-wrap: wrap !important;
  max-height: none !important;
  overflow: visible !important;
  gap: 2px !important;
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: center !important;
}

.multi-line-select .ant-select-selection-item {
  margin: 2px !important;
  max-width: 100% !important;
  height: auto !important;
  line-height: 1.2 !important;
  word-break: break-all !important;
  white-space: normal !important;
  font-size: 10px !important;
}

.multi-line-select .ant-select-selection-overflow-item {
  margin: 0 !important;
}

.multi-line-select .ant-select-selection-placeholder {
  font-size: 12px !important;
}

.multi-line-select .ant-select-selection-search {
  font-size: 12px !important;
}

.ant-select-dropdown {
  font-size: 12px !important;
  z-index: 10001 !important;
}

/* 确保Antd选择器正确处理键盘事件 */
.ant-select {
  outline: none !important;
}

.ant-select-dropdown.ant-slide-up-leave {
  display: none !important; /* 修复Escape后菜单动画问题 */
}

/* 禁用Ant Design默认的选项高亮行为 */
.keyboard-navigation-dropdown .ant-select-item-option-active {
  background-color: transparent !important;
}

/* 高亮选中项的样式 */
.ant-select-item-option-selected {
  background-color: rgba(75, 85, 99, 0.6) !important;
}

/* 为下拉菜单中的键盘聚焦选项添加样式 */
.keyboard-focused-option {
  background-color: rgba(79, 70, 229, 0.2) !important;
  border-left: 3px solid #6366f1 !important;
  padding-left: 6px !important;
  color: white !important;
  font-weight: 500 !important;
}

/* 确保键盘导航焦点在选项上清晰可见 */
.keyboard-navigation-dropdown .ant-select-item-option.keyboard-focused-option {
  background-color: rgba(79, 70, 229, 0.3) !important;
  z-index: 2 !important;
  position: relative !important;
}

/* 修复选项hover与焦点样式之间的冲突 */
.keyboard-navigation-dropdown .ant-select-item:hover:not(.keyboard-focused-option) {
  background-color: rgba(55, 65, 81, 0.4) !important;
}

/* 修复搜索输入框的问题 */
.ant-select-selection-search-input {
  color: white !important;
  background: transparent !important;
}

/* 确保搜索输入焦点更明显 */
.ant-select-focused .ant-select-selector {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* 优化下拉菜单的滚动显示 */
.ant-select-dropdown-placement-bottomLeft {
  overflow: auto !important;
  max-height: 320px !important;
}

/* 确保下拉菜单项有足够的高度和间距 */
.ant-select-item {
  padding: 6px 12px !important;
  transition: all 0.2s !important;
}

/* 自定义OptGroup标题样式 */
.ant-select-item-group .ant-select-item-group-title {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-right: 8px !important;
}

/* 增强键盘导航的视觉反馈 */
.ant-select-item-option:focus {
  outline: 2px solid #6366f1 !important;
}

/* 优化键盘导航时的焦点显示 */
.ant-select-dropdown:focus-within {
  outline: none !important;
}

/* 确保选项可以接收焦点 */
.ant-select-item {
  cursor: pointer !important;
}

/* 当使用键盘导航时的高亮样式 */
.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
  background-color: #4b5563 !important;
  color: white !important;
}

/* 确保 antd 的下拉菜单项不会被其他样式覆盖 */
.keyboard-navigation-dropdown .ant-select-item-option-active {
  background-color: transparent !important;
}

/* 当选项被键盘导航聚焦时的样式优先级更高 */
.keyboard-navigation-dropdown .ant-select-item-option.keyboard-focused-option {
  background-color: rgba(79, 70, 229, 0.3) !important;
  z-index: 1;
}

/* 避免鼠标悬停样式覆盖键盘导航样式 */
.keyboard-navigation-dropdown .ant-select-item:hover:not(.keyboard-focused-option) {
  background-color: rgba(55, 65, 81, 0.4) !important;
}

/* 当有键盘焦点时外框样式 */
.keyboard-navigation-select.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* 确保下拉菜单在全屏模式下也能显示 */
.dark-dropdown-menu.ant-select-dropdown {
  z-index: 10001 !important;
}

/* 全局提高Ant Select下拉菜单的层级 */
div[class^="ant-select-dropdown"] {
  z-index: 10001 !important;
} 